package com.svpino.netflix.parsers;

import org.w3c.dom.Element;

import com.svpino.netflix.Proxy;
import com.svpino.netflix.Response;

public abstract class AbstractParser<T> implements Parser<T> {

	private final Proxy proxy;

	public AbstractParser(Proxy proxy) {
		this.proxy = proxy;
	}

	protected Element request(String resource) throws Exception {
		Response response = this.proxy.request(resource);
		return response.getXmlElement();
	}

	protected Proxy getProxy() {
		return this.proxy;
	}

}
